package com.itheima.demo;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class IONumberDemo {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(new File("DAY12_IO\\number.txt")));
        String s = br.readLine();
        String[] split = s.split(",");
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < split.length; i++) {
            list.add(Integer.parseInt(split[i]));
        }
        Collections.sort(list, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                int i = o1 - o2;
                return i;
            }
        });
        String[] str = new String[list.size()];
        for (int i = 0; i < list.size(); i++) {
            list.get(i);
        }
        /*String s1 = list.toString();
        BufferedWriter bw = new BufferedWriter(new FileWriter(new File("DAY12_IO\\number.txt"),true));
        bw.write(s1);
        br.close();
        bw.close();*/
    }
}
